<html>
<head>
    <meta charset="UTF-8">
    <title>投参吉林“吉林·长白山人参”招商引资平台</title>
    <meta name="viewport" content="initial-scale=1,maximum-scale=1, minimum-scale=1">
    <script src="js/jquery.js"></script>
    <script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
<script src="http://h5.jlrbyy.cn/wxjson/js/wx-rs.js?v=1.03"  type="text/javascript"></script> 

<link rel="stylesheet" type="text/css" href="css/base.css?v=1.8">
<link rel="stylesheet" type="text/css" href="css/style.css?v=1.8">
    <link rel="stylesheet" href="swiper/swiper-bundle.min.css" />
    <script type="text/javascript">
        document.documentElement.style.fontSize = document.documentElement.clientWidth / 750*100 + 'px';
    </script>
    <style>
        body {
            background-color: #fff;
            margin: 0;
        }
        .content{
            background-color: #fff;
        }
    </style>
</head>
<body>
<div class="container">
    <div class="header">
        <div class="header_top">
            <img src="./images/logo.png" id="logo" alt="">
            <img src="./images/logo1.png"  id="logo1" alt="">
        </div>
    </div>
    <div class="content" style="margin-top: -0.1rem">
        <ul id="content">
        </ul>
    </div>

</div>


</body>
<script>
    function getUrlParam(name) {
        const urlParams = new URLSearchParams(window.location.search);
        return urlParams.get(name);
    }

    console.log(getUrlParam('id'));
    var columnid= getUrlParam('tag')
    var search=decodeURIComponent(getUrlParam('search'))
    var pagenow=1
    getnewslist(columnid,pagenow)

    $(window).scroll(function() {
            var viewHeight = document.body.clientHeight; //可见高度
            var contentHeight = $(".container").get(0).scrollHeight  //内容高度
            var scrollHeight = $(this).scrollTop(); //滚动高度
            if (viewHeight + scrollHeight>= contentHeight) {
                console.log("到达底部");
                pagenow++
                getnewslist(columnid,pagenow)
            }
    });
    function getnewslist(columnid,pagenow){
        $.ajax({
            url: 'https://www.cailianxinwen.com/app/notice/renewPage?page=true&columnid='+columnid+'&pagenow='+pagenow,
            dataType: "json",
            //jsonp: "jsoncallback",
            success: function (json) {
                console.log(json)
                if(json.datas.length==0)
                {
                    var screenHeight = window.innerHeight;

                    // 打印到控制台
                    console.log('屏幕高度为：' + screenHeight + '像素');
                   // $('.footer').attr('style','position: fixed;width: 100%;bottom: 0;')
                }
                // 获取视口高度

                let _html=''
                $.each(json.datas, function(index, value){

                    if(value.titleimg!=null){
                        _html+=`
                        <a href="item.html?id=${value.id}">
                                  <li class="news-pic">
                                    <img src="${value.titleimg}" alt=""/>
                                  <div>
                                    <span class="title">${value.title}</span>
                                    <span class="time">${value.posttime}</span>
                                  </div>
                                </li>
                        </a>
`
console.log(index)
                    }
                    else
                    {
                        _html+=`
                            <a href="item.html?id=${value.id}">
                                    <li class="news">
                                    <span class="title">${value.title}</span>
                                          <span class="time">${value.posttime}</span>
                                    </li>
                                    </a>
                              `
                    }
     
                })
                $('#content').append(_html)
            },

        });



    }
</script>
</html>